package com.sgb.kjwl.di.lookingforAJob;

import com.sgb.kjwl.repository.HomeRepertory;
import com.sgb.kjwl.repository.impl.HomeRepertoryImpl;
import com.sgb.kjwl.view.ui.activity.lookingforAJob.FindWorksActivity;
import com.sgb.kjwl.view.ui.activity.packers.MapFindWorkActivity;
import com.sgb.kjwl.viewmodel.lookingforAJob.FindWorksAtvModel;
import com.sgb.kjwl.viewmodel.packers.MapFindWorkModel;
import com.swgk.core.base.di.Activity;
import com.swgk.core.base.api.BaseApiSource;
import com.swgk.core.base.model.preference.BasePreferenceSource;

import dagger.Module;
import dagger.Provides;

@Module
public class WorksModule {

    private FindWorksActivity findWorksActivity;

    private MapFindWorkActivity mapFindWorkActivity;

    public WorksModule(MapFindWorkActivity mapFindWorkActivity) {
        this.mapFindWorkActivity = mapFindWorkActivity;
    }

    public WorksModule(FindWorksActivity findWorksActivity) {
        this.findWorksActivity = findWorksActivity;
    }


    @Provides
    @Activity
    HomeRepertory provideHomeRepertory(BaseApiSource apiSource, BasePreferenceSource preferenceSource) {
        return new HomeRepertoryImpl(apiSource, preferenceSource);
    }



    @Provides
    @Activity
    FindWorksAtvModel findWorksAtvModel(HomeRepertory repertory) {
        return new FindWorksAtvModel(findWorksActivity, repertory);
    }

    @Provides
    @Activity
    MapFindWorkModel provideMapFindWorkModel(HomeRepertory repertory) {
        return new MapFindWorkModel(mapFindWorkActivity, repertory);
    }



}
